﻿using System;
using System.Windows.Forms;

namespace MedicinskiUslugi {

	public partial class frmMain : Form {

		public string MainConnectionString { set; get; }

		public int User { set; get; }

		public string UserNameAndSurname { set; get; }

		public int UserLevel { set; get; }

		public string NazivNaFirma { set; get; }

		public string NazivNaProgramata { set; get; }

		public frmMain( string ConnectionString, int User_Id, string UserFullName, int usrLevel ) {
			this.User = User_Id;
			this.UserNameAndSurname = UserFullName;
			this.MainConnectionString = ConnectionString;
			this.UserLevel = usrLevel;
			InitializeComponent();
			this.UserFullNameTxt.Text = this.UserNameAndSurname;
			NazivNaFirma = "Elkomp";
			NazivNaProgramata = "Медицински услуги 2012";
			this.Text = NazivNaProgramata + " - " + NazivNaFirma;
		}

		private void frmMain_FormClosed( object sender, FormClosedEventArgs e ) {
			Application.Exit();
		}

		private void излезToolStripMenuItem_Click( object sender, EventArgs e ) {
			this.Close();
		}

		private void frmMain_FormClosing( object sender, FormClosingEventArgs e ) {
			DialogResult opc;
			opc = MessageBox.Show( "Дали сте сигурни ?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question );
			if ( opc == DialogResult.No ) {
				e.Cancel = true;
			}
		}

		private void општиниToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmOpstini opstina = new frmOpstini();
			opstina.MainConnection = this.MainConnectionString;
			opstina.MdiParent = frmMain.ActiveForm;
			opstina.Text = општиниToolStripMenuItem.Text;
			opstina.Show();
		}

		private void економскиЕдинициToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmEEdinici EEdinica = new frmEEdinici();
			EEdinica.MainConnection = this.MainConnectionString;
			EEdinica.MdiParent = frmMain.ActiveForm;
			EEdinica.Text = економскиЕдинициToolStripMenuItem.Text;
			EEdinica.Show();
		}

		private void ценовникToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmCenovnik Cenovnik = new frmCenovnik();
			Cenovnik.MainConnection = this.MainConnectionString;
			Cenovnik.MdiParent = frmMain.ActiveForm;
			Cenovnik.Text = ценовникToolStripMenuItem.Text;
			Cenovnik.Show();
		}

		private void претпријатиаToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmPretprijatia Pretrpijatia = new frmPretprijatia();
			Pretrpijatia.MainConnection = this.MainConnectionString;
			Pretrpijatia.MdiParent = frmMain.ActiveForm;
			Pretrpijatia.Text = претпријатиаToolStripMenuItem.Text;
			Pretrpijatia.Show();
		}

		private void групаНаМедицинскиМатеријалиToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmGrupaMat Grupa = new frmGrupaMat();
			Grupa.MainConnection = this.MainConnectionString;
			Grupa.MdiParent = frmMain.ActiveForm;
			Grupa.Text = групаНаМедицинскиМатеријалиToolStripMenuItem.Text;
			Grupa.Show();
		}

		private void медицинскиМатеријалиToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmMedicinskiMat MedicinskiMaterijali = new frmMedicinskiMat();
			MedicinskiMaterijali.MainConnection = this.MainConnectionString;
			MedicinskiMaterijali.MdiParent = frmMain.ActiveForm;
			MedicinskiMaterijali.Text = медицинскиМатеријалиToolStripMenuItem.Text;
			MedicinskiMaterijali.Show();
		}

		private void медицинскиУслугиToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmMedicinskiUslugi MedicinskiUslugi = new frmMedicinskiUslugi();
			MedicinskiUslugi.MainConnection = this.MainConnectionString;
			MedicinskiUslugi.MdiParent = frmMain.ActiveForm;
			MedicinskiUslugi.Text = медицинскиУслугиToolStripMenuItem.Text;
			MedicinskiUslugi.Show();
		}

		private void извршителиToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmIzvrsiteli Izvrsiteli = new frmIzvrsiteli();
			Izvrsiteli.MainConnection = this.MainConnectionString;
			Izvrsiteli.MdiParent = frmMain.ActiveForm;
			Izvrsiteli.Text = извршителиToolStripMenuItem.Text;
			Izvrsiteli.Show();
		}

		private void услугиМатеријалиToolStripMenuItem_Click( object sender, EventArgs e ) {
		}

		private void шифрарникНаДијагнозиToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmDijagnozi Dijagnozi = new frmDijagnozi();
			Dijagnozi.MainConnection = this.MainConnectionString;
			Dijagnozi.MdiParent = frmMain.ActiveForm;
			Dijagnozi.Text = шифрарникНаДијагнозиToolStripMenuItem.Text;
			Dijagnozi.Show();
		}

		private void матичниЛекариToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmMaticniLekari Lekari = new frmMaticniLekari();
			Lekari.MainConnection = this.MainConnectionString;
			Lekari.MdiParent = frmMain.ActiveForm;
			Lekari.Text = матичниЛекариToolStripMenuItem.Text;
			Lekari.Show();
		}

		private void рачноToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmVnesVoSpecifikacijaRacno specifikacijaRacno = new frmVnesVoSpecifikacijaRacno();
			specifikacijaRacno.MainConnection = this.MainConnectionString;
			specifikacijaRacno.MdiParent = frmMain.ActiveForm;
			// specifikacijaRacno.Text = матичниЛекариToolStripMenuItem.Text;
			specifikacijaRacno.Show();
		}

		private void податоциЗаЗаглавјеToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmZaglavje ZaglavJe = new frmZaglavje();
			ZaglavJe.MainConnection = this.MainConnectionString;
			ZaglavJe.MdiParent = frmMain.ActiveForm;
			ZaglavJe.Text = матичниЛекариToolStripMenuItem.Text;
			ZaglavJe.Show();
		}

		private void пациентиToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmPacient Pacient = new frmPacient();
			Pacient.MainConnection = this.MainConnectionString;
			Pacient.MdiParent = frmMain.ActiveForm;
			Pacient.Text = матичниЛекариToolStripMenuItem.Text;
			Pacient.Show();
		}

		private void автоматскиToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmAvtomatski SpecAvtomatski = new frmAvtomatski();
			// SpecAvtomatski.MainConnection = this.MainConnectionString;
			SpecAvtomatski.MdiParent = frmMain.ActiveForm;
			SpecAvtomatski.Text = матичниЛекариToolStripMenuItem.Text;
			SpecAvtomatski.Show();
		}

		private void измениВоСпецификацијаToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmZaglavjeSpecifikacija specifikacijaIzmeni = new frmZaglavjeSpecifikacija();
			specifikacijaIzmeni.MainConnection = this.MainConnectionString;
			specifikacijaIzmeni.MdiParent = frmMain.ActiveForm;
			specifikacijaIzmeni.Text = измениВоСпецификацијаToolStripMenuItem.Text;
			specifikacijaIzmeni.Show();
		}

		private void кориснициToolStripMenuItem_Click( object sender, EventArgs e ) {
			frmKorisnici korisnik = new frmKorisnici();
			korisnik.MainConnection = this.MainConnectionString;
			korisnik.MdiParent = frmMain.ActiveForm;
			korisnik.Text = кориснициToolStripMenuItem.Text;
			korisnik.Show();
		}
	}
}